package com.yqg.education.common.result;

import java.io.Serializable;

/***
 * Json格式的数据进行响应
 */
public class Result<E> implements Serializable {
    /**状态码*/
    private Integer code;
    /**描述信息*/
    private String message;
    /**数据*/
    private E data;

    public Result(ResultCodeEnum e) {
        this.code = e.getCode();
        this.message = e.getMessage();
    }

    public Result(ResultCodeEnum e, E data) {
        this.code = e.getCode();
        this.message = e.getMessage();
        this.data = data;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public E getData() {
        return data;
    }

    public void setData(E data) {
        this.data = data;
    }
}
